package com.weilx959.spt.core.constants;

import lombok.AllArgsConstructor;
import lombok.Getter;
import org.apache.commons.lang3.StringUtils;

import java.util.Arrays;

@Getter
@AllArgsConstructor
public enum ThemeEnum {
    LIGHT("light", "assets/css/theme-light.css"),
    DARK("dark", "assets/css/theme-dark.css");

    private final String code;

    private final String style;

    public static ThemeEnum valueOfCode(String code) {
        return Arrays.stream(ThemeEnum.values())
            .filter(e -> StringUtils.equals(code, e.getCode()))
            .findFirst()
            .orElse(null);
    }
}
